#include <algorithm>
#include <vector>
#include <string>

using namespace std;

bool GT6(const string &);
bool isShorter(const string &, const string &);

void Count_ifTest()
{
	vector<string> strv;
	string resultV, resultIt;
	string srcStr = "// comparison function to be used to sort by word length";
	vector<string>::size_type count = srcStr.size();
	for(int i = 0; i < 20; i ++)
	{
		strv.push_back(srcStr.substr(rand() % count, rand() % count));
	}
	
	vector<string>::difference_type diffCount = count_if(strv.begin(), strv.end(), GT6);
	stable_sort(strv.begin(), strv.end(), isShorter);
}

bool GT6(const string &str)
{
	return str.size() >= 6;
}

bool isShorter(const string &strA, const string &strB)
{
	return strA.size() < strB.size();
}